import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Random;

public class TestGen8 {
    static final Random randomrandom = new Random();
    static double nextDouble(int n){
        Random random1 = new Random();
        return n * random1.nextDouble();
    }
    static double nextDouble(){
        Random random = new Random();
        return nextDouble(random.nextInt());
    }
    public static void main(String[] args) throws FileNotFoundException {
        //System.out.println(nextDouble());
       // System.out.println(nextDouble());
        print(0, 20);
        print(1, 2);
    }
    private static void print(int task, int count) throws FileNotFoundException {
        PrintWriter printWriter;
        String fileName, stringFormat;
        int d, n, m;

        if (task == 0) {
            fileName = "correctness_tests/";
            stringFormat = "%02d";
            d = randomrandom.nextInt(5) + 1;
            n = randomrandom.nextInt(50) + 1;
            m = randomrandom.nextInt(10) + 1;

        } else {
            fileName = "performance_tests/";
            d = 100;
            n = 1000;
            m = 100;
            stringFormat = "%03d";
        }

        for (int i = 0; i < count; i++) {
            String s = fileName + String.format(stringFormat, i + 1) + ".in";
            printWriter = new PrintWriter(s);
            if(task == 0){
                d = randomrandom.nextInt(5) + 1;
                n = randomrandom.nextInt(50) + 1;
                m = randomrandom.nextInt(10) + 1;
            }
            generate(printWriter, d, n, m);
            printWriter.close();
        }
    }
    static void generate(PrintWriter out, int d, int n, int m){
        Random random1 = new Random();
        d = Math.abs(d);
        n = Math.abs(n);
        m = Math.abs(m);
        out.println(d + " " + n + " " + m);
        for(int i = 0; i < n; i++){
            for(int j = 0;  j < d; j++){
                out.print(nextDouble() + " ");
            }
            out.println();
        }
        for(int i = 0; i < m; i++){
            double[] left = new double[d];
            for(int j = 0; j < d; j++){
                left[j] = nextDouble();
            }
            for(Double doub : left){
                out.print(doub + " ");
            }
            for(Double doub : left){
                out.print(doub + Math.abs(random1.nextInt()) + " ");
            }
            out.println();
        }
    }
}
